package lesson03;

public class Demo_301 {
    public static void main(String[] args) throws InterruptedException {
        test test1=new test();
        test test2=new test();
            Thread thread1 =new Thread(()->{
                    test1.func();
            });
        Thread thread2 =new Thread(()->{
                    test1.func();
        });
        thread1.start();
        thread2.start();
        thread1.join();
        thread2.join();
        System.out.println(test.count);
    }
}

class  test{
    static int count=0;
    //int count=0;
    public void func(){
        for(int i=0;i<50000;i++)
            count++;
    }

}